package dataManager;

import java.util.ArrayList;
import java.util.List;

import po.Customer;

public class CustomerDataManager {
private List<Customer> listCustomer;
	
	public CustomerDataManager(){
		listCustomer=new ArrayList<Customer>();
	}
	
	public void addCustomerInMemory(Customer e){
		listCustomer.add(e);
	}
	
	public List<Customer> listCustomerByCid(String cid){
		List<Customer> glist = new ArrayList<Customer>();
		if(cid==null){
			return listCustomer;
		}else{
			for(Customer g:listCustomer){
				if(cid.equals(g.getId())){
					glist.add(g);
				}
			}
			return glist;
		}
	}
}
